goog.provide('lfpug.ui.renderer.StoriesRenderer');
goog.require('goog.functions');
goog.require('lfpug.ui.Renderer');
goog.require('templates.lfpug.ui.component.StoriesComponent');



/**
 * @constructor
 * @extends {lfpug.ui.Renderer}
 */
lfpug.ui.renderer.StoriesRenderer = function() {
  goog.base(this);
};
goog.inherits(
    lfpug.ui.renderer.StoriesRenderer,
    lfpug.ui.Renderer
);
goog.addSingletonGetter(lfpug.ui.renderer.StoriesRenderer);


/**
 * @const
 * @type {lfpug.ui.ComponentFactory.FactoryContext}
 */
lfpug.ui.renderer.StoriesRenderer.FACTORY_CONTEXT =
    lfpug.ui.ComponentFactory.getUniqueContext('ListRenderer');


/** @override */
lfpug.ui.renderer.StoriesRenderer.prototype.getFactoryContext =
    goog.functions.constant(
    lfpug.ui.renderer.StoriesRenderer.FACTORY_CONTEXT);


/**
 * Register that the CategoryComponent should render
 * with the Advanced Renderer in the context of ListRenderer
 *
lfpug.ui.ComponentFactory.register(
    lfpug.ui.presentation.CategoryPM,
    function(category) {

      return new lfpug.ui.component.Category(
          /** @type {lfpug.ui.presentation.CategoryPM} * (category),
          lfpug.ui.renderer.category.Advanced.getInstance());
    },
    lfpug.ui.renderer.StoriesRenderer.FACTORY_CONTEXT
);
*/


/**
 * Custom CSS Class.
 * @const
 * @type {string}
 */
lfpug.ui.renderer.StoriesRenderer.CSS_CLASS =
    goog.getCssName('stories-component');


/**
 * @return {string}
 *         The custom css class.
 */
lfpug.ui.renderer.StoriesRenderer.prototype.getCssClass =
    goog.functions.constant(lfpug.ui.renderer.StoriesRenderer.CSS_CLASS);


/**
 * @const
 * @type {lfpug.ui.type.Template}
 */
lfpug.ui.renderer.StoriesRenderer.TEMPLATE =
    /** @type {lfpug.ui.type.Template} */
    (templates.lfpug.ui.component.StoriesComponent.Structure);


/**
 * @return {lfpug.ui.type.Template}
 *         The template Function.
 */
lfpug.ui.renderer.StoriesRenderer.prototype.getTemplate =
    goog.functions.constant(lfpug.ui.renderer.StoriesRenderer.TEMPLATE);


/**
 * @param {lfpug.ui.Component} component
 *        Component object to render.
 *
 * @return {lfpug.ui.type.TemplateObject}
 *         Returns the template object.
 */
lfpug.ui.renderer.StoriesRenderer.prototype.getTemplateObject =
    function(component) {
  var object = {};
  object.Id = component.getId();
  object.CssClass = this.getCssClass();
  object.TagName = this.getTagName();
  return object;
};


/**
 *
 * @param {lfpug.ui.Component} component
 *        Component object to render.
 * @return {string} The result html.
 */
lfpug.ui.renderer.StoriesRenderer.prototype.getTemplateContent =
    function(component)  {
  var template, object;
  template = this.getTemplate();
  object = this.getTemplateObject(component);
  return template(object);
};

